package com.chengrui.encry;

import io.xjar.XKit;
import io.xjar.boot.XBoot;
import io.xjar.key.XKey;

import java.util.Date;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @author
 * @version 1.0.0
 * @description
 * @createTime 2023/12/01
 */
public class CodeEncry {


    /**
     * 筑科
     * @throws Exception
     */
    private  static void execYtzkcg() throws Exception {

        String password = "Ldz.tyzkcg.0101";
//		String password = args[0];
        XKey xKey = XKit.key(password);
        XBoot.encrypt("D:\\Workspace\\tyzk-cg\\sub-project\\admin\\target\\admin-0.0.1-SNAPSHOT.jar", "D:\\TEST\\jar\\admin\\admin-encry-0.0.1-SNAPSHOT.jar", xKey);
//        XBoot.encrypt("D:\\Workspace\\tyzk-cg\\sub-project\\jobs\\target\\jobs.jar", "D:\\TEST\\jar\\jobs\\jobs-encry-0.0.1-SNAPSHOT.jar", xKey);
//        XBoot.encrypt("D:\\Workspace\\tyzk-cg\\sub-project\\rest\\target\\rest-0.0.1-SNAPSHOT.jar", "D:\\TEST\\jar\\rest\\rest-encry-0.0.1-SNAPSHOT.jar", xKey);


    }

    /**
     * 民生
     */
    private static void exuecYtwmsMS(){

        new Thread(()->{
            try {
                String password1 = "Ldz.ytwms.ms1010";
                XKey xKey1 = XKit.key(password1);
                XBoot.encrypt("D:\\Workspace\\ck-yyth-origin\\yyth-admin\\target\\yyth-admin.jar", "D:\\YTWMS\\01 民生\\ytwms\\ytwms-1.0.jar", xKey1);
            } catch (Exception e) {
                e.printStackTrace();
            }
            System.out.println("01 民生："+new Date());
        }).start();

        new Thread(()->{
            try {
                String password1 = "Ldz.ytwms.ms1010";
                XKey xKey1 = XKit.key(password1);
                XBoot.encrypt("D:\\Workspace\\ck-yyth-origin\\yyth-lightstep\\target\\yyth-lightstep.jar", "D:\\YTWMS\\01 民生\\ytwms-lightstep\\ytwms-lightstep.jar", xKey1);
            } catch (Exception e) {
                e.printStackTrace();
            }
            System.out.println("01 民生lightstep："+new Date());
        }).start();

    }

    /**
     * 天佑佳
     */
    private static void exuecYtwmsTYJ(){


        new Thread(()->{
            try {
                String password1 = "Ldz.ytwms.tyj1010";
                XKey xKey1 = XKit.key(password1);
                XBoot.encrypt("D:\\Workspace\\ck-yyth-origin\\yyth-admin\\target\\yyth-admin.jar", "D:\\YTWMS\\02 天佑佳\\ytwms\\ytwms-1.0.jar", xKey1);
//                XBoot.encrypt("D:\\Workspace\\ck-yyth\\yyth-admin\\target\\yyth-admin.jar", "D:\\YTWMS\\天佑佳\\ytwms\\ytwms-1.0.jar", xKey1);
            } catch (Exception e) {
                e.printStackTrace();
            }
            System.out.println("02 天佑佳:"+new Date());
        }).start();
        new Thread(()->{
            try {
                String password1 = "Ldz.ytwms.tyj1010";
                XKey xKey1 = XKit.key(password1);
                XBoot.encrypt("D:\\Workspace\\ck-yyth-origin\\yyth-lightstep\\target\\yyth-lightstep.jar", "D:\\YTWMS\\02 天佑佳\\ytwms-lightstep\\ytwms-lightstep.jar", xKey1);
            } catch (Exception e) {
                e.printStackTrace();
            }
            System.out.println("02 天佑佳lightstep"+new Date());
        }).start();
    }
    /**
     * 四川嘉润辰医药有限公司
     */
    private static void exuecYtwmsJRC(){


        new Thread(()->{
            try {
                String password1 = "Ldz.ytwms.JRC1010";
                XKey xKey1 = XKit.key(password1);
                XBoot.encrypt("D:\\Workspace\\ck-yyth-origin\\yyth-admin\\target\\yyth-admin.jar", "D:\\YTWMS\\03 嘉润辰\\ytwms\\ytwms-1.0.jar", xKey1);
//                XBoot.encrypt("D:\\Workspace\\ck-yyth\\yyth-admin\\target\\yyth-admin.jar", "D:\\YTWMS\\天佑佳\\ytwms\\ytwms-1.0.jar", xKey1);
            } catch (Exception e) {
                e.printStackTrace();
            }
            System.out.println("03 嘉润辰:"+new Date());
        }).start();
        new Thread(()->{
            try {
                String password1 = "Ldz.ytwms.JRC1010";
                XKey xKey1 = XKit.key(password1);
                XBoot.encrypt("D:\\Workspace\\ck-yyth-origin\\yyth-lightstep\\target\\yyth-lightstep.jar", "D:\\YTWMS\\03 嘉润辰\\ytwms-lightstep\\ytwms-lightstep.jar", xKey1);
            } catch (Exception e) {
                e.printStackTrace();
            }
            System.out.println("03 嘉润辰lightstep"+new Date());
        }).start();
    }

    /**
     * 同瑞医药有限公司
     */
    private static void exuecYtwmsTR(){


        new Thread(()->{
            try {
                String password1 = "Ldz.ytwms.TR1010";
                XKey xKey1 = XKit.key(password1);
                XBoot.encrypt("D:\\Workspace\\ck-yyth-origin\\yyth-admin\\target\\yyth-admin.jar", "D:\\YTWMS\\04 同瑞\\ytwms\\ytwms-1.0.jar", xKey1);
//                XBoot.encrypt("D:\\Workspace\\ck-yyth\\yyth-admin\\target\\yyth-admin.jar", "D:\\YTWMS\\天佑佳\\ytwms\\ytwms-1.0.jar", xKey1);
            } catch (Exception e) {
                e.printStackTrace();
            }
            System.out.println("04 同瑞:"+new Date());
        }).start();
        new Thread(()->{
            try {
                String password1 = "Ldz.ytwms.TR1010";
                XKey xKey1 = XKit.key(password1);
                XBoot.encrypt("D:\\Workspace\\ck-yyth-origin\\yyth-lightstep\\target\\yyth-lightstep.jar", "D:\\YTWMS\\04 同瑞\\ytwms-lightstep\\ytwms-lightstep.jar", xKey1);
            } catch (Exception e) {
                e.printStackTrace();
            }
            System.out.println("04 同瑞 lightstep"+new Date());
        }).start();
    }

    public static void main(String[] args) throws Exception {

//        execYtzkcg();
        exuecYtwmsMS();
//        exuecYtwmsTYJ();
//        exuecYtwmsJRC();
//        exuecYtwmsTR();

/*        Pattern pattern = Pattern.compile("#\\{[a-zA-Z0-9_]+\\}");
        String string = "select * from a = #{abc}";
        Matcher matcher = pattern.matcher(string);
        String str = matcher.replaceAll("aaa");
        System.out.println(str);*/

    }
}
